﻿using System;
using System.Collections.Generic;
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
using QuickTest.Core.TestRunner;

namespace QuickTest.Tests.Core.TestRunner
{
    [TestFixture]
    public class TestPackageTests
    {
        [Test]
        public void Can_Create_TestPackage()
        {
            const string name = "TestPackageName";
            const string basePath = "TestBasePath";

            ITestPackage testPackage = new TestPackage(new List<string> {NUnitTestRunnerTests.GetTestAssemblyPath()}, name, basePath);

            Assert.That(testPackage.Assemblies, Is.Not.Null, "Should intialise assembly list");
            Assert.That(testPackage.Name, Is.EqualTo(name), "Should intialise package name");
            Assert.That(testPackage.BasePath, Is.EqualTo(basePath), "Should intialise base path");
        }

        [Test]
        public void Cannot_Create_TestPackage_With_Null_Assembly_List()
        {
            TestUtils.AssertThrows<ArgumentNullException>(() => new TestPackage(null));
        }
    }
}